#include<stdio.h>
#include<string.h>
#include<assert.h>
void reverse(char* left,char* right)
{
    assert(left&&right);
    while(left<right)
    {
        char tmp=*left;
        *left=*right;
        *right=tmp;
        left++;
        right--;
    }
}
int main()
{
    char s[100],i,j,k=0;
    gets(s);
    reverse(s,s+strlen(s)-1);
    for(i=0;i<=strlen(s);i++)
    {
        if(s[i]==' '||s[i]=='\0')
        {
            for(j=i-1;j>=k;j--)
            printf("%c",s[j]);
            k=i+1;
            printf(" ");
        }
    
    }
    

}